/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.permission.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.L200;
import queenb.net.entitybean.Q350;
import queenb.web.permission.inteface.Q350Inf;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class Q350Store extends Q350 implements Q350Inf {

    @Override
    public List<Q350> getListQ350All(int pnFH000, int pPQ350, int pnFH200) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_Q350, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pPQ350),
                    new Param(OracleTypes.INTEGER, pnFH200),
                });
        try {
            return super.find(dataStatement, Q350.class);
        } catch (SQLException ex) {
            Logger.getLogger(Q350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(Q350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(Q350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int updateQ350(int pnPQ350, int pnFH000, int pnFH200, String pvQV351, String pvLOGIN) {
         try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_Q350, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPQ350),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvQV351),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, Q350.class);
        } catch (SQLException ex) {
            Logger.getLogger(Q350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int deleteQ350(int pnPQ350, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_Q350, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPQ350),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStatement, Q350.class);
        } catch (SQLException ex) {
            Logger.getLogger(Q350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
    
}
